﻿using Quartz;
using System;
using System.Threading.Tasks;
using WaterCloud.Code;
using WaterCloud.Service.STZBManage;

namespace WaterCloud.Web.Job
{
    /// <summary>
    /// 账户信息定时任务
    /// </summary>
    public class Account_Job : IJob
    {
        /// <summary>
        /// 业务逻辑层
        /// </summary>
        public STZB_AccountService _service { get; set; }
        public Account_Job(STZB_AccountService sTZB_AccountService)
        {
            _service = sTZB_AccountService;
        }

        public async Task Execute(IJobExecutionContext context)
        {
            try
            {
                await _service.UpdateState();
            }
            catch (Exception ex)
            {
                LogHelper.WriteWithTime($"账户状态更新任务报错：{ex.Message}");
                throw;
            }
        }
    }
}
